<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="leagal_aid.bean.*,java.util.*,java.io.*" %>
<%
	request.setCharacterEncoding("utf-8");
	String username = request.getParameter("username");
	String phonenumber = request.getParameter("phonenumber");
	String password = request.getParameter("password");
	System.out.print(username);
	Admin admin = new Admin();
	if(admin.doAdd(username,phonenumber, password)){
		response.setCharacterEncoding("utf-8");
		PrintWriter pout = response.getWriter();
		pout.print("<script>alert('增加成功'); window.location='../add_success.jsp'</script>");
		pout.flush();
		pout.close();
	}else {
		response.setCharacterEncoding("utf-8");
		PrintWriter pout = response.getWriter();
		pout.print("<script>alert('请更改账号'); window.location='../add_admin.jsp' </script>");
		pout.flush();
		pout.close();
		//response.sendRedirect("login.html");
	};

%>